package com.program.cloudmanagesystem.login.service;
import com.program.cloudmanagesystem.login.persistence.StateMapper;
import com.program.cloudmanagesystem.login.domain.State;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StateService {
    @Autowired
    private StateMapper stateMapper;
    public StateService(){}
    public List<State> showStates(){
        return stateMapper.shouwStates();
    }
    public void addState(State state){
        stateMapper.addState(state.getObject(),state.getParkingrate(),state.getCheckrate(),state.getCapacityrate());
    }
    public State saerchState(String id){
        return stateMapper.searchState(id);
    }
    public void updateNow(State state){
        stateMapper.updateNow(state.getObject(),state.getParkingrate(),state.getCheckrate(),state.getCapacityrate());
    }
}
